<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection" />
		<meta content="emai=no" name="format-detection" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST ?>shared/css/shared.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST ?>gene/css/common.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST ?>gene/css/report.css" />
		<script type="text/javascript" src="<?php echo STATIC_HOST ?>shared/js/zepto-1.1.6.js"></script>
		<script type="text/javascript" src="<?php echo STATIC_HOST ?>shared/js/echarts.min.js"></script>
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<title>芝士妈妈在线</title>
		<script>

			Zepto(function($) {
				function onBridgeReady() {
					WeixinJSBridge.call('showOptionMenu');
				};

				if (typeof WeixinJSBridge == "undefined") {
					if (document.addEventListener) {
						document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
					} else if (document.attachEvent) {
						document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
						document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
					}
				} else {
					onBridgeReady();
				}

				$("body").delegate('.popup-text li', 'touchstart', function(e) {
					e.preventDefault();
					e.stopPropagation();
					initWxShare($(this).text(),$(this).data("des"));
					zsmm.Popup.clear();
					zsmm.Popup.New($('.popup-share'));
				});
			});


			wx.config({
				debug: false,
				appId: '<?php echo $jsapi['js_config']['appId']?>',
				timestamp: <?php echo $jsapi['js_config']['timestamp']?>,
				nonceStr: '<?php echo $jsapi['js_config']['noncestr']?>',
				signature: '<?php echo $jsapi['js_config']['signature']?>',
				jsApiList: [
					'onMenuShareTimeline',
					'onMenuShareAppMessage'
				]
			});

			function initWxShare(str,des) {
				wx.ready(function () {
					wx.onMenuShareTimeline({
						title: str,
						link: '<?php echo $jsapi['share_url']?>', // 分享链接
						imgUrl: 'http://wx.zhishimama.com/img/salon_offline.png', // 分享图标
						success: function () {
							// 用户确认分享后执行的回调函数
						},
						cancel: function () {
							// 用户取消分享后执行的回调函数
						}
					});

					wx.onMenuShareAppMessage({
						title: str,
						desc: des, // 分享描述
						link: '<?php echo $jsapi['share_url']?>', // 分享链接
						imgUrl: 'http://wx.zhishimama.com/img/salon_offline.png', // 分享图标
						type: 'link', // 分享类型,music、video或link，不填默认为link
						dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
						success: function () {
							// 用户确认分享后执行的回调函数
						},
						cancel: function () {
							// 用户取消分享后执行的回调函数
						}
					});
				});
			}

			<?php
				if($product_id == 3){
					echo '			Zepto(function ($) {
				function onBridgeReady() {
					WeixinJSBridge.call(\'hideOptionMenu\');
				}

				if (typeof WeixinJSBridge == "undefined") {
					if (document.addEventListener) {
						document.addEventListener(\'WeixinJSBridgeReady\', onBridgeReady, false);
					} else if (document.attachEvent) {
						document.attachEvent(\'WeixinJSBridgeReady\', onBridgeReady);
						document.attachEvent(\'onWeixinJSBridgeReady\', onBridgeReady);
					}
				} else {
					onBridgeReady();
				}
			});';
				}
			?>

		</script>
	</head>

	<body>
		<input type="hidden" id="bind_no" value="<?php echo $bind_no ?>" />
		<?php if($share):?>
		<div class="invitation">
			<p>恭喜您成为芝士妈妈代言人，芝士妈妈奉上您的分享专属二维码，通过此二维码您的好友可以获得折扣红包，下单可抵扣现金哦~同时您将获得一笔代言费，分享越多，获益越多！</p>
			<p class="title">
				专属邀请卡<br >
				<img class="arrow" src="<?php echo STATIC_HOST?>gene/img/d_arrow.png" />
			<p>
				<img class="qrcode" src="<?php echo STATIC_IMAGE . $share['share_image']?>" />
			<p class="notice">
				长按保存图片，发送给好友即可。<br/> 芝士妈妈保留对芝妈优选代言规则的最终解释权。
			</p>
		</div>
		<?php endif;?>
		<p class="share-link clear">
			<span class="s-right"><a onclick="zsmm.Popup.New($('.popup-text'),0)">分享我的基因</a></span>
			</p>
			<a class="top-link" href="#top">
				<img class="fullScreen" src="<?php echo STATIC_HOST ?>gene/img/d_top.png" />
			</a>
			<div class="hide popup-text">
				<div class="vertical">
					<ul>
						<h3>选择我要分享的基因</h3>
						<li data-des="<?php echo $report_1_text ?>"><?php echo $report_1_share ?></li>
						<li data-des="<?php echo $report_2_text ?>"><?php echo $report_2_share ?></li>
						<li data-des="<?php echo $report_3_text ?>"><?php echo $report_3_share ?></li>
						<li data-des="<?php echo $report_4_text ?>"><?php echo $report_4_share ?></li>
						<li data-des="<?php echo $report_5_text ?>"><?php echo $report_5_share ?></li>
					</ul>
				</div>
			</div>
			<div class="hide popup-share" onclick="zsmm.Popup.clear()">
				<img class="fullScreen" src="<?php echo STATIC_HOST ?>gene/img/d_share_report.png" />
			</div>
			<script type="text/javascript" src="<?php echo STATIC_HOST ?>shared/js/shared.js"></script>
			<script type="text/javascript" src="<?php echo STATIC_HOST ?>gene/js/config.js"></script>
			<script type="text/javascript" src="<?php echo STATIC_HOST ?>gene/js/<?php if($product_id == 2){ echo 'report.js'; } elseif($product_id == 3){echo 'report_vd.js';} ?>"></script>
	</body>

</html>